<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="/html/axios.min.js"></script>
    <script>
        function $(id) {
            return document.getElementById(id)
        }
        function land(){
            axios.get("/user/login",{
                params:{
                    name:$("userName").value,
                    pwd:$("pwd").value
                }
            }).then(resp=>{
                if (resp.data=='ok'){
                    location.href="/html/index.html"
                }
                else {
                    $("errorDiv").innerHTML ="登录失败";
                }
            })
        }

    </script>
</head>
<body>
    <div style="background-color: skyblue">
        <a href="index.html">首页</a> |
        <a href="login.html">登录</a> |
        <a href="register.html">注册</a> |
        <a>退出</a> |
        <a>管理</a> |
        <a>风格</a>
    </div>
    <form>
    <div id="errorDiv" style="color: red"></div>
    用户名：<input type="text" id="userName"><br>
    密码：<input type="password" id="pwd"><br>
    <input type="button" value="登录" onclick="land()">
    <input type="reset" value="重置">
    </form>
</body>
</html>